package com.ghp.interfas.config;


import com.ghp.interfas.interceptor.DyeDataInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ghp
 * @title
 * @description
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    /**
     * 注册拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 添加流量染色拦截器
        registry.addInterceptor(new DyeDataInterceptor())
                .addPathPatterns("/**");
    }
}
